<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <script src="./vue.js"></script>
  <script src="./vue-router.js"></script>
</head>
<body>
  <div id="app">
      <router-link to='/books'>books</router-link>
      <router-link to='/news'>news</router-link>
      <hr>
      <router-view></router-view>
  </div>
  <!-- <script src="./vue.js"></script> -->
  <script>
      const news = {template: '<h1>news page </h1>'}
      const books = {template: '<h1>books page </h1>'}

    const routers = new VueRouter({
        routes : [{path:'/books',component: books},{path:'/news',component: news}]
    })

    var vm = new Vue({
      el:'#app',
      data:{
      },
      router: routers
     });
  </script>
</body>
</html>
